package com.woniuxy.relation.app.controller;

import com.woniuxy.commons.util.Result;
import com.woniuxy.relation.client.AccountRelationClient;
import com.woniuxy.relation.service.service.AccountRelationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @auther 黄磊
 * @2022/8/1 14:31
 **/
@RestController
@RequestMapping("/accountRelation")
@Api(tags = "用户关注关系接口")

public class AccountRelationController implements AccountRelationClient {

    @Resource
    private AccountRelationService accountRelationService;

    @ApiOperation("当前登录用户关注其他用户")
    @Override
    public Result attentionScreen(@PathVariable("followedAccountId") String followedAccountId) {
        accountRelationService.attentionScreen(followedAccountId);

        return Result.getInstance().setMsg("关注成功") ;
    }

    @Override
    public Result cancelScreen(@PathVariable String followedAccountId) {
        accountRelationService.cancelScreen(followedAccountId);
        return Result.getInstance().setMsg("取消关注成功");
    }

}
